package com.woniu34.search.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

@Document(indexName = "movie",type = "moviedocs",shards = 3,replicas = 1)
public class MovieSearch {


    @Field(index = true,type=FieldType.Text,analyzer = "ik_max_word")
    private String allText;

    /** 主键 */
    @Id
    @Field(index = false,type = FieldType.Long)
    private Long movieId;

    /** 影片名称 */
    @Field(index = false,type = FieldType.Keyword)
    private String movieName;

    /** 上映时间 */
    @Field(index = false,type = FieldType.Date)
    private Date movieReleaseTime;

    /** 影片描述 */
    @Field(index = false,type = FieldType.Keyword)
    private String movieInfo;

    /** 影片海报 */
    @Field(index = false,type = FieldType.Keyword)
    private String movieImg;

    /** 影片英文名 */
    @Field(index = false,type = FieldType.Keyword)
    private String movieEname;

    /** 评分 */
    @Field(index = false,type = FieldType.Double)
    private BigDecimal movieScore;

    /** 影片上映年份 */
    @Field(index = false,type = FieldType.Long)
    private Long movieReleaseYear;

    @Field(index = false,type = FieldType.Keyword)
    private String movieAreaStr;
    @Field(index = false,type = FieldType.Keyword)
    private String movieTypeStr;


    @Override
    public String toString() {
        return "MovieSearch{" +
                "allText='" + allText + '\'' +
                ", movieId=" + movieId +
                ", movieName='" + movieName + '\'' +
                ", movieReleaseTime=" + movieReleaseTime +
                ", movieInfo='" + movieInfo + '\'' +
                ", movieImg='" + movieImg + '\'' +
                ", movieEname='" + movieEname + '\'' +
                ", movieScore=" + movieScore +
                ", movieReleaseYear=" + movieReleaseYear +
                '}';
    }


    public String getMovieAreaStr() {
        return movieAreaStr;
    }

    public void setMovieAreaStr(String movieAreaStr) {
        this.movieAreaStr = movieAreaStr;
    }

    public String getMovieTypeStr() {
        return movieTypeStr;
    }

    public void setMovieTypeStr(String movieTypeStr) {
        this.movieTypeStr = movieTypeStr;
    }

    public String getAllText() {
        return allText;
    }

    public void setAllText(String allText) {
        this.allText = allText;
    }

    public Long getMovieId() {
        return movieId;
    }

    public void setMovieId(Long movieId) {
        this.movieId = movieId;
    }

    public String getMovieName() {
        return movieName;
    }

    public void setMovieName(String movieName) {
        this.movieName = movieName;
    }

    public Date getMovieReleaseTime() {
        return movieReleaseTime;
    }

    public void setMovieReleaseTime(Date movieReleaseTime) {
        this.movieReleaseTime = movieReleaseTime;
    }

    public String getMovieInfo() {
        return movieInfo;
    }

    public void setMovieInfo(String movieInfo) {
        this.movieInfo = movieInfo;
    }

    public String getMovieImg() {
        return movieImg;
    }

    public void setMovieImg(String movieImg) {
        this.movieImg = movieImg;
    }

    public String getMovieEname() {
        return movieEname;
    }

    public void setMovieEname(String movieEname) {
        this.movieEname = movieEname;
    }

    public BigDecimal getMovieScore() {
        return movieScore;
    }

    public void setMovieScore(BigDecimal movieScore) {
        this.movieScore = movieScore;
    }

    public Long getMovieReleaseYear() {
        return movieReleaseYear;
    }

    public void setMovieReleaseYear(Long movieReleaseYear) {
        this.movieReleaseYear = movieReleaseYear;
    }
}
